package kr.salebeans.cm.provider.shop.impl;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import kr.salebeans.cm.domain.shop.Shop;
import kr.salebeans.cm.provider.shop.ShopProvider;

public class ShopProviderImpl implements ShopProvider{

	@PersistenceContext
	private EntityManager em;
	
	@Override
	public Shop createShop(Shop shop) {
		em.persist(shop);
		return shop;
	}
	
	@Override
	public Shop updateShop(Shop shop) {
		return em.merge(shop);
	}
	
	@Override
	public Shop retriveShop(String shopId) {
		return em.find(Shop.class, shopId);
	}
}
